home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / message / subcls / minapp.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-31  |  1.3 KB  |  41 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Minimized Application"
  4.    ClientHeight    =   3330
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   4605
  8.    Height          =   3735
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3330
  14.    ScaleWidth      =   4605
  15.    Top             =   1140
  16.    Width           =   4725
  17.    WindowState     =   1  'Minimized
  18.    Begin MsgHook MsgHook 
  19.       Left            =   180
  20.       Top             =   225
  21.    End
  22. Option Explicit
  23. ' We want to catch WM_QUERYOPEN
  24. Const WM_QUERYOPEN = &H13
  25. Sub Form_Load ()
  26.    ' Ensure minimized state (could also be set at design
  27.    ' time).  Set MinButton and MaxButton to False at
  28.    ' design time for cleaner control menu.
  29.    Me.WindowState = 1  'Minimized
  30.    ' Setup MsgHook
  31.    MsgHook.HwndHook = Me.hWnd
  32.    MsgHook.Message(WM_QUERYOPEN) = True
  33. End Sub
  34. Sub MsgHook_Message (Msg As Integer, wParam As Integer, lParam As Long, Result As Long)
  35.    ' Prevent icon from restoring by returning 0.
  36.    ' No need to invoke default window procedure.
  37.    If Msg = WM_QUERYOPEN Then
  38.       Result = 0
  39.    End If
  40. End Sub
  41.